<?php
include_once '../DBAccess/DBAccess.php';
include_once '../Algos/Heating/consoHeating.php';
include_once '../Algos/Floor/deperditionFloor.php';
include_once '../Algos/Roof/deperditionRoof.php';
include_once '../Algos/Wall/deperditionWalls.php';
include_once '../Algos/Window/deperditionWindows.php';
include_once '../Algos/deperditionTransmission.php';
include_once '../Algos/deperditionByVentilation.php';
include_once '../Objects/Wall.php';
include_once '../Objects/Floor.php';
include_once '../Objects/Roof.php';
include_once '../Objects/House.php';
include_once '../Objects/Window.php';
include_once '../Objects/HeatPump.php';
include_once '../Objects/Oilboiler.php';
include_once '../Objects/WoodPelletBoiler.php';
include_once '../Objects/SoapstoneBoiler.php';
/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

try
  {
    $Mysql = new DBAccess('153.109.141.81:3306', 'savenrj', 'root', '');
    
    $windows1 = array();           
    $windows1[0] = new Window(1, 1, 2, true, 2 , 2.2 , 0.22, 0.1, 0.15, '', '', '', '');
    $windows1[1] = new Window(1, 1, 2, true, 2 , 2.2 , 0.22, 0.1, 0.15, '', '', '', '');
    
    $windows2 = array();
    $windows2[0] = new Window(1, 1, 2, true, 2 , 2.2 , 0.22, 0.1, 0.15, '', '', '', '');
    $windows2[1] = new Window(1, 1, 2, true, 2 , 2.2 , 0.22, 0.1, 0.15, '', '', '', '');
    
    
    
    $walls = array();
    
    $walls[0] = new Wall('M1', 1, 1, 60, '', $windows1, '');
    $walls[1] = new Wall('M2', 2, 2, 60, '', $windows2, '');
    
    $floor;
    $floor = new Floor(1);
    
    $roof;
    $roof = new Roof(1, null, null, 5);
    
    
    
    $heating;
    //$heating = new HeatPump(4000, 1, 20, 1 , true);
    //$heating = new OilBoiler(4000, 3, '', '', true);
    //$heating = new WoodPelletBoiler(200, TRUE, 2);
    $heating = new SoapstoneBoiler(25);
    
    $house;
    
 $house = new House(4, 1, 1, 2, 50, 100, '', '', '', '', '', 77, 20, 2, 1975, $walls, $floor, null, $roof, null, $heating, false, false);
     //$house = new House(4, 1, 1, 'square', 'Sion', 20, 2, 1970, 150 , 30, $walls, false , false);

    
    
    $algo;
    $algo = new deperditionByVentilation();
    
    //echo 'TotalWin : '.$algo2->getTotalSurfaceWindows($walls);
   
    echo '<br></br>Déperdition totale';
    echo '<br></br>'.$algo->getDeperditionByVentilation($house, 500);
    
    

    
     
  
   
    
  }
  catch (MySQLExeption $e) 
  {
    echo $e -> RetourneErreur();
  }











?>
